#include <57header.h>

void *func(void *p){

    void *x = malloc(100);
    int fd = open("1.txt", O_RDWR);

    int times = 0;
    while(1){
        sleep(1);
        write(fd, "hello", 5);
        times++;

        if(times > 1000){
            break;
        }
    }
    
    close(fd);
    free(x);
    return NULL;
}
int main(int argc,char*argv[])
{
    pthread_t son_id;
    pthread_create(&son_id, NULL, func, NULL);

    sleep(20);
    pthread_cancel(son_id);

    pthread_join(son_id, NULL);
    return 0;
}

